#include <iostream>
using namespace std;
int x=100;
class WithStatic{
    static int x;
    static int y;
    public:
    void print() const{
       cout << "WithStatic::x =" << x <<endl;
       cout << "WithStatic::y =" << y <<endl; 
    }
    static void f(){

    };
};

int WithStatic::x = 1;
int WithStatic::y = x+1;
//x ->  WithStatic::x  使用全局变量需要使用::x

int main(){
    WithStatic ws;
    WithStatic::f();
    ws.print();
}